<?php

namespace Module;

class SearchModule extends BaseModule {

    public function searchAction() {
        $args = \Lib\Registry::get('args'); 
        $q = trim($args['q']);
        $posts = \Lib\Model\PostModel::search($q);
                
        return $this->showTemplate(__FUNCTION__, array(
            'posts'=> (array)$posts,
            'bc' => array(
                \Lib\Registry::get('view')->__('Home') => '/',
                \Lib\Registry::get('view')->__('Search result') => ''
             ),
            'title'=> \Lib\Registry::get('view')->__('Search result').': "'.$q.'"'
            ));
    }

}

?>
